package cars;

public class Bus extends Vehicle {
    private int seat;

    public Bus() {
    }
    //无参

    public Bus(String type, String brand, int seat, String vehicleID, double perRent) {
        super(type, brand, vehicleID, perRent);
        this.seat = seat;
    }
    //有参

    public int getSeat() {
        return seat;
    }
    //获得载客

    public void setSeat(int seat) {
        this.seat = seat;
    }
    //设置载客

    @Override
    public double calRent(int day) {
        if (day >= 150) {
            return 1.0 * getPerRent() * day * 0.6;
        } else if (day >= 30) {
            return 1.0 * getPerRent() * day * 0.7;
        } else if (day >= 7) {
            return 1.0 * getPerRent() * day * 0.8;
        } else if (day >= 3) {
            return 1.0 * getPerRent() * day * 0.9;
        } else {
            return 1.0 * getPerRent() * day * 0.7;
        }
    }
    //计算租金

    @Override
    public String toString() {
        return getType() + " " + getBrand() + " " + seat + " " + getVehicleID() + " " + getPerRent();
    }
    //返回汽车
}
